﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Actuals.CoreDomain;
using Actuals.CoreDomain.Data;
using System.Data;
using System.Collections;
using Actuals.Data;

namespace Actuals.Data
{
    public class DalEmployeeLeavesNew : Dal<IEmployeeLeavesNew, EmployeeLeavesNew>, IDalEmployeeLeavesNew
    {
        private readonly IDalManager _manager;
        private static readonly IDalEmployeeLeavesNew _instance = new DalEmployeeLeavesNew();

        public static IDalEmployeeLeavesNew Instance
        {
            get { return _instance; }
        }
        public DalEmployeeLeavesNew()
        {
            _manager = new DalManager();
        }
        public DalEmployeeLeavesNew(IDalManager manager)
        {
            _manager = manager;
        }
        protected override void Convert(IEmployeeLeavesNew obj, DataRow row)
        {
            obj.EmployeeId = _manager.GetValue<int>(row, "EmployeeId");
            obj.FromDate = _manager.GetValue<DateTime>(row, "FromDate");
            obj.AM = _manager.GetValue<bool>(row, "AM");
            obj.PM = _manager.GetValue<bool>(row, "PM");
            obj.AM1 = _manager.GetValue<bool>(row, "AM1");
            obj.PM1 = _manager.GetValue<bool>(row, "PM1");
            obj.ToDate = _manager.GetValue<DateTime>(row, "ToDate");
            obj.LeaveType = _manager.GetValue<string>(row, "LeaveType");

        }
    }
}


